/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package consumo.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Carlos Taschetto
 */
@Entity
@Table(name = "azul", catalog = "consumodb", schema = "")
@NamedQueries({
    @NamedQuery(name = "Azul.findAll", query = "SELECT a FROM Azul a"),
    @NamedQuery(name = "Azul.findById", query = "SELECT a FROM Azul a WHERE a.id = :id"),
    @NamedQuery(name = "Azul.findByInicio", query = "SELECT a FROM Azul a WHERE a.inicio = :inicio"),
    @NamedQuery(name = "Azul.findByKWhPS", query = "SELECT a FROM Azul a WHERE a.kWhPS = :kWhPS"),
    @NamedQuery(name = "Azul.findByKWhPU", query = "SELECT a FROM Azul a WHERE a.kWhPU = :kWhPU"),
    @NamedQuery(name = "Azul.findByKWhFPS", query = "SELECT a FROM Azul a WHERE a.kWhFPS = :kWhFPS"),
    @NamedQuery(name = "Azul.findByKWhFPU", query = "SELECT a FROM Azul a WHERE a.kWhFPU = :kWhFPU"),
    @NamedQuery(name = "Azul.findByKWP", query = "SELECT a FROM Azul a WHERE a.kWP = :kWP"),
    @NamedQuery(name = "Azul.findByKWFP", query = "SELECT a FROM Azul a WHERE a.kWFP = :kWFP")})
public class Azul implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id", nullable = false)
    private Integer id;
    @Basic(optional = false)
    @Column(name = "inicio", nullable = false)
    @Temporal(TemporalType.DATE)
    private Date inicio;
    @Column(name = "kWhPS", precision = 10, scale = 6)
    private BigDecimal kWhPS;
    @Column(name = "kWhPU", precision = 10, scale = 6)
    private BigDecimal kWhPU;
    @Column(name = "kWhFPS", precision = 10, scale = 6)
    private BigDecimal kWhFPS;
    @Column(name = "kWhFPU", precision = 10, scale = 6)
    private BigDecimal kWhFPU;
    @Column(name = "kWP", precision = 10, scale = 6)
    private BigDecimal kWP;
    @Column(name = "kWFP", precision = 10, scale = 6)
    private BigDecimal kWFP;
    @JoinColumn(name = "tarifa", referencedColumnName = "id", nullable = false)
    @ManyToOne(optional = false)
    private Tarifa tarifa;

    public Azul() {
    }

    public Azul(Integer id) {
        this.id = id;
    }

    public Azul(Integer id, Date inicio) {
        this.id = id;
        this.inicio = inicio;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getInicio() {
        return inicio;
    }

    public void setInicio(Date inicio) {
        this.inicio = inicio;
    }

    public BigDecimal getKWhPS() {
        return kWhPS;
    }

    public void setKWhPS(BigDecimal kWhPS) {
        this.kWhPS = kWhPS;
    }

    public BigDecimal getKWhPU() {
        return kWhPU;
    }

    public void setKWhPU(BigDecimal kWhPU) {
        this.kWhPU = kWhPU;
    }

    public BigDecimal getKWhFPS() {
        return kWhFPS;
    }

    public void setKWhFPS(BigDecimal kWhFPS) {
        this.kWhFPS = kWhFPS;
    }

    public BigDecimal getKWhFPU() {
        return kWhFPU;
    }

    public void setKWhFPU(BigDecimal kWhFPU) {
        this.kWhFPU = kWhFPU;
    }

    public BigDecimal getKWP() {
        return kWP;
    }

    public void setKWP(BigDecimal kWP) {
        this.kWP = kWP;
    }

    public BigDecimal getKWFP() {
        return kWFP;
    }

    public void setKWFP(BigDecimal kWFP) {
        this.kWFP = kWFP;
    }

    public Tarifa getTarifa() {
        return tarifa;
    }

    public void setTarifa(Tarifa tarifa) {
        this.tarifa = tarifa;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Azul)) {
            return false;
        }
        Azul other = (Azul) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "consumo.persistence.Azul[id=" + id + "]";
    }

}
